//
//  EditableCellController.m
//  TarPhone
//
//  Created by Ishra on 20/03/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "EditableCellController.h"


@implementation EditableCellController

@synthesize title;

- (id) initWithTitle:(NSString*)inTitle {
	self = [super init];
	if (self) {
		title = inTitle;
	}
	return self;
}

- (UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath {
	return UITableViewCellAccessoryNone;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
	
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	static NSString *stationCellIdentifier = @"EditableTableCell";
	
	cell = (EditableTableCell*) [tableView dequeueReusableCellWithIdentifier:stationCellIdentifier];
	if (cell == nil) {
        [[NSBundle mainBundle] loadNibNamed:@"EditableTableCell" owner:self options:nil];
	}
	
	
	[((EditableTableCell*)cell) setCellTitle:title];
	return cell;
}

- (id) getData {
	return [((EditableTableCell*)cell) getText];
}

- (IBAction) editableFieldDone:(id)sender {
	[sender resignFirstResponder];
}




@end

